﻿<%@ Page Language="C#" MasterPageFile="~/Student/StuMasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Student_Default2" Title="Untitled Page" %>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentBody" Runat="Server">

<style type="text/css">
#zuixindongtai{
    height:30px;
	width:100%;
	background: #f5ee2b url(../Image/最新动态.gif) no-repeat;
}
#content{
    float:left right;
}
</style>

<form runat="server">
<div id="content" style=" text-align:center; width: 100%;">
    <div id="zuixindongtai">
    </div>
    <div id="message" style="text-align:center ;">
    <asp:DataGrid ID="news" runat="server" DataSourceID="SqlDataSource1" CellPadding="4" GridLines="None"
     AllowSorting="True"  ShowFooter="True" AutoGenerateColumns="False"  ForeColor="#333333" Height="79px" Width="453px">
        <FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
        <SelectedItemStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <ItemStyle BackColor="#EFF3FB" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <Columns>
            
            <asp:BoundColumn HeaderText ="ID"  DataField="id" />
            <asp:HyperLinkColumn HeaderText ="标题" DataTextField="title" DataNavigateUrlField ="id" DataNavigateUrlFormatString="../Common/ShowNews.aspx?id={0}" Target="_blank"/>
            <asp:BoundColumn HeaderText="发布人" DataField="publisher" />
            <asp:BoundColumn HeaderText="发布日期" DataField ="date" />
        </Columns>
        <EditItemStyle BackColor="#2461BF" />
        <AlternatingItemStyle BackColor="White" />
    </asp:DataGrid>
    </div>
    
    <asp:SqlDataSource
        ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:onlineexamConnectionStringForNews %>"
        SelectCommand="SELECT * FROM [t_news]">
    </asp:SqlDataSource>
</div>
</form>  
</asp:Content>

